#include<bits/stdc++.h>

using namespace std;
const int n = 10;
struct Student {
    int number;
    char name[100];
    int lesson[3];
} students[n];

void input(Student &student) {
    cin >> student.number >> student.name;
    for (int i = 0; i < 3; i++) {
        cin >> student.lesson[i];
    }
}

void output(Student &student) {
    printf("%d %s %d %d %d\n", student.number, student.name,
           student.lesson[0], student.lesson[1], student.lesson[2]);
}

bool cmp(Student a, Student b) {
    return a.lesson[0] + a.lesson[1] + a.lesson[2]
           >
           b.lesson[0] + b.lesson[1] + b.lesson[2];
}

int main() {
    freopen("E.in", "r", stdin);
    double average[3] = {0.0};
    for (int i = 0; i < n; i++) {
        input(students[i]);
        for (int j = 0; j < 3; j++) {
            average[j] += 1.0 * students[i].lesson[j] / n;
        }
    }
    printf("%.2f %.2f %.2f\n", average[0], average[1], average[2]);
    sort(students, students + n, cmp);//按照总分排降序
    output(students[0]);

    return 0;
}